package com.hey.qrcode.controller;

import com.hey.qrcode.common.result.SingleResult;
import com.hey.qrcode.service.SysService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {

    @Autowired
    SysService sysService;

    @PostMapping(value = "/sys/login", produces = "application/json")
    @ApiOperation(value = "管理员登录", httpMethod = "POST")
    public SingleResult sysLogin(@ApiParam(name = "sysName", value = "管理员名", required = true)
                                 @RequestParam(value = "sysName", required = true) String sysName,
                                 @ApiParam(name = "sysPass", value = "管理员密码", required = true)
                                 @RequestParam(value = "sysPass", required = true) String sysPass
    ) {
        return sysService.sysLogin(sysName, sysPass);
    }
}
